package com.coco.dao.Impl;

import java.sql.SQLException;
import java.util.List;

import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanListHandler;

import com.coco.dao.ProductDao;
import com.coco.model.Product;
import com.coco.utils.C3P0Util;

public class ProductDaoImpl implements ProductDao {

	@Override
	public List<Product> findByOthers(String sql, Object...params) throws SQLException {
		QueryRunner qr = new QueryRunner(C3P0Util.getDataSource());
		return qr.query(sql, new BeanListHandler<>(Product.class),params);
	}

}

	